package com.zzf.concurrent.example.design.pattern.read.writer;

/**
 * @author GaoFeng2017
 * @date 2019/9/7 10:42
 */
public class Client {
    public static void main(String[] args) {
        // ShareData shareData = new ShareData(10);
        ShareData shareData = new ShareData(10, false);
        Thread r1 = new ReaderWorker(shareData);
        Thread r2 = new ReaderWorker(shareData);
        Thread r3 = new ReaderWorker(shareData);
        Thread r4 = new ReaderWorker(shareData);
        Thread w1 = new WriterWorker(shareData, "123456789");
        Thread w2 = new WriterWorker(shareData, "abcdefg");

        r1.start();
        r2.start();
        r3.start();
        r4.start();
        w1.start();
        w2.start();
    }
}
